import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    nav: [],
    btn: []
  },
  mutations: {
    setNav(state, data){  // 设置导航菜单
      state.nav = data;
    },
    setBtn(state, data){
      state.btn = data
    }
  },
  actions: {
    SETNAV({commit},data){  //添加导航数据
      commit('setNav',data);
    },
    SETBTN({commit}, data){
      commit('setBtn', data)
    }
  },
  modules: {
  }
})

